<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>表格Demo</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="./css/font.css">
    <link rel="stylesheet" href="./css/xadmin.css">
    <script type="text/javascript" src="./lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="./js/xadmin.js"></script>
</head>

<body>

    <form class="layui-form user-from" lay-filter="example">

        <div class="layui-form-item">
            <label class="layui-form-label">澡堂名称:</label>
            <div class="layui-input-block">
                <input type="text" name="regionName" disabled="true" autocomplete="off" class="layui-input" />
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">澡堂单价:</label>
            <div class="layui-input-block">
                <input type="text" name="regionPrice" disabled="true" autocomplete="off" class="layui-input" />
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">创建时间:</label>
            <div class="layui-input-block">
                <input type="text" name="regionDate" disabled="true" autocomplete="off" class="layui-input" />
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">澡堂状态:</label>
            <div class="layui-input-block">
                <input type="text" name="regionState" disabled="true" autocomplete="off" class="layui-input" />
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">澡堂简介:</label>
            <div class="layui-input-block">
                <input type="text" name="regionIntroduce" disabled="true" autocomplete="off" class="layui-input" />
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">澡堂图片:</label>
            <div class="layui-input-block">
                <div style="margin-right: 20px" id="regionImgs"></div>
            </div>
        </div>
    </form>
    <script>

        layui.use(['jquery', 'layer', 'form'], function () {
            var $ = layui.jquery;
            var layer = layui.layer;
            var form = layui.form;

            var req = GetRequest();
            var regionId = req['regionId'];
            $.ajax({
                url: '/getRegionById',
                data: {
                    regionId: regionId
                },
                dataType: 'json',
                type: 'Post',
                success: function (res) {
                    data = res.data;
                    form.val("example", data);
                    (data.regionImgs).forEach(item => {
                        $('#regionImgs').append('<img  src="' + item + '" alt="" srcset="" disabled="true" name="menuImg" id="menuImg" width="100" height="100" />');
                    })
                }
            })
        });
    </script>


</body>